package cn.hiapi.publics.query;

import cn.hiapi.basic.jpa.pageable.QueryWrapper;
import cn.hiapi.basic.jpa.query.BasicQuery;
import cn.hiapi.shopkeeper.enums.ActivityType;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

/**
 * @author AdinZ
 * @date 2022/12/16 23:31
 */
@Setter
@Getter
public class ActivityQuery extends BasicQuery {
    private Long shopId;
    private ActivityType type;
    private Long cid;

    @ApiModelProperty("状态")
    private Integer status;

    @Override
    public QueryWrapper getQueryWrapper() {
        QueryWrapper wrapper = super.getBasicQueryWrapper();
        wrapper.eq("cid", cid)
                .eq("type", type)
                .eq("status", 1)
                .eq("shopId", shopId);
        return wrapper;
    }
}
